﻿//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: OEJoin.cs
//
//  Description: Simple join for the ObjectExpression.
// 
//--------------------------------------------------------------------------

using System;

namespace Chili.Opf3.Query.OPathParser
{
	/// <summary>
	/// Represents a simple join in the OPath statement. 
	/// </summary>
	/// <remarks>
	/// Simple joins in a OPath statement are converted to this class when OPath is compiled.
	/// </remarks>
	[Serializable]
	public sealed class OEJoin : OEItem
	{
		private PersistentAttribute _attribute;

		/// <summary>
		/// Creates a new instance of the <see cref="OEJoin">OEJoin Class</see>.
		/// </summary>
		/// <param name="attribute">The <see cref="Opf3.PersistentAttribute">PersistentAttribute</see>
		/// of the joined persistent object.</param>
		internal OEJoin(PersistentAttribute attribute)
		{
			_attribute = attribute;
		}

		/// <summary>
		/// Returns the <see cref="Opf3.PersistentAttribute">PersistentAttribute</see> of the joined 
		/// persistent object.
		/// </summary>
		/// <value>The <see cref="Opf3.PersistentAttribute">PersistentAttribute</see>
		/// of the joined persistent object.</value>
		public PersistentAttribute PersistentAttribute
		{
			get { return _attribute; }
		}
	}
}
